package com.gitee.dgwcode.mapper;

import java.util.List;

import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionTemplate;
import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.gitee.dgwcode.bean.Employee;

@Repository
public class EmployeeDao extends SqlSessionDaoSupport {
	
	
	@Autowired
	public void setSqlSession(SqlSessionTemplate sqlSession) {
		super.setSqlSessionTemplate(sqlSession);
	}
	public List<Employee> getEmps(){
		SqlSession session = getSqlSession();
		EmployeeMapper mapper = session.getMapper(EmployeeMapper.class);
		List<Employee> emps = mapper.getEmps();
		return emps;
	}

}
